package leetcode;

public class Leetcode338 {
    public int[] countBits(int num) {
        int[] dp = new int[num+1];
        for (int i = 1; i <= num; i++) {
            if((i&1)==0){
                dp[i] = dp[i>>1];
            }else{
                dp[i] = dp[i-1];
            }
        }
        return dp;
    }
}
